package homework;

public class homework11 {
	public static void main(String[] args) {
		int[] arr={4,1,6,3,9,8};
		int[] newArr=copyArrRange(arr,2,4);
		printArr(newArr);
	}
	public static int[] copyArrRange(int[] arr,int x,int y){
		int number=y-x+1;
		int[] newArr=new int[number];
		for(int i=0;i<newArr.length;i++){
			newArr[i]=arr[x];
			x++;
		}
		return newArr;
	}
	public static void printArr(int[] arr){
		for(int i=0;i<arr.length;i++){
			System.out.println(arr[i]);
		}
	}
}
